-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BEAM-14474] Suppress 'Mean of empty slice' Runtime Warning in dataframe unit test #17682
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
Codecov Report
@@ Coverage Diff @@
## master #17682 +/- ##
==========================================
- Coverage 73.99% 73.99% -0.01%
==========================================
Files 695 695
Lines 91798 91798
==========================================
- Hits 67927 67922 -5
- Misses 22623 22628 +5
Partials 1248 1248
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think we should consider filtering these warnings in the actual implementation so they don't show up when the user is building a pipeline and we're generating a proxy. Would you mind filing a jira for that?
|
||
def median_sum_fn(x): | ||
return (x.foo + x.bar).median() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would actually keep these where they are and just duplicate the filterwarnings calls, so that the tests are more self-contained and easy to inspect (but I'm also fine with the move if you prefer it that way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree with the idea. Given the amount of code added I considered pick up them into a separate helper function. Nevertheless it is still in the GroupByTest test class.
@staticmethod | ||
def median_sum_fn(x): | ||
warnings.filterwarnings("ignore", message="Mean of empty slice") | ||
return (x.foo + x.bar).median() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use a context here to make sure the filters get reset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. Applied.
Entered BEAM-14477 for construction time warnings. |
Currently the log of python unit test results contains thousands of lines of runtime warning / future warning / deprecation warnings, making trouble shooting during development inconvenient. The most popped warning is hundreds of lines of 'RuntimeWarning: Mean of empty slice
return np.nanmean(a, axis, out=out, keepdims=keepdims)'
raised in dataframe tests, which costs > 400 lines of logs. This warning could be suppressed.
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.